package com.dayuanit.dy16.ebook.ebookweb.mapper;

import com.dayuanit.dy16.ebook.ebookweb.entity.Cart;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

@Repository
public interface CartMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Cart record);

    int insertSelective(Cart record);

    Cart selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(Cart record);

    int updateByPrimaryKey(Cart record);

    Cart getByCommoAndUserId(@Param("commodityId") Long commodityId, @Param("userId") Long userId);

    int updateBuyNum(@Param("cartId") Long cartId, @Param("buyNumber") Integer buyNumber);

    List<Cart> listByUserId(Long userId);

    List<Cart> listByIds(@Param("cartIds") List<Long> cartIds);
}